<!--
  @Author: Cyril Hou
  @Email: houshoushuai@gmail.com
  @Created At: 2016-10-31 10:36:36.
-->

<template>
  <div id="loading" v-if="loading" v-loading="true">
  </div>
</template>
<style lang="stylus" scoped>
#loading {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100px;
  overflow: auto;
  background: #ecf0f1;
  opacity: .99;
  .loader {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 50%;
    left: 50%;
    margin-left: -25px;
    margin-top: -25px;
    svg {
      width: 100%;
      height: 100%;
    }
    svg path, svg rect {
      fill: #d95857
    }
  }
}
  //  Spinner loading
.spinner {
  position: absolute;
  width: 50px;
  height: 50px;
  margin: 50px auto;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  background: #d95857;
  top: 50%;
  left: 50%;
  margin-left: -25px;
  margin-top: -25px;
}
.spinner:before,
.spinner:after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #fff;
  opacity: 1;
  position: absolute;
  top: 0;
  left: 0;
  -webkit-animation: bounce 1s infinite ease-in-out;
  animation: bounce 1s infinite ease-in-out;
}
.spinner:after {
  background: #d95857;
  -webkit-animation-delay: 0.15s;
  animation-delay: 0.15s;
}
@-webkit-keyframes bounce {
  0% {
    -webkit-transform: scale(0);
  }
  80%, 100% {
    -webkit-transform: scale(1);
  }
}
@keyframes bounce {
  0% {
    transform: scale(0);
  }
  80%, 100% {
    transform: scale(1);
  }
}

.spinner-square {
  width: 60px;
  height: 60px;
  margin: 100px auto;
  -webkit-animation: rotate 1.4s infinite ease-in-out, background 1.4s infinite ease-in-out alternate;
  animation: rotate 1.4s infinite ease-in-out, background 1.4s infinite ease-in-out alternate;
}

@-webkit-keyframes rotate {
  0% {
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
    transform: perspective(120px) rotateX(0deg) rotateY(0deg);
  }
  50% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
    transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
  }
  100% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
    transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
  }
}

@keyframes rotate {
  0% {
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
    transform: perspective(120px) rotateX(0deg) rotateY(0deg);
  }
  50% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
    transform: perspective(120px) rotateX(-180deg) rotateY(0deg);
  }
  100% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
    transform: perspective(120px) rotateX(-180deg) rotateY(-180deg);
  }
}

</style>
<script>
export default {
  data () {
    return {
      loading: true
    }
  }
}
</script>
